<?php
/**
 * Project: Recipe
 * File: KitchenArticleModel.class.php
 * Author: Xnfy520@gmail.com
 * Date: 12-5-26
 * Time: 下午3:43
 */


class KitchenArticleModel extends RelationModel{

	protected $_validate = array(
		array('name', 'require', '食谱名称不能为空', 1, 'regex', 3),
	);

	protected $_auto = array(
		array('created', 'time', 1, 'function'), //发表时间
		array('modified', 'time', 3, 'function'), //修改时间
	);

	protected $_link = array(

		'User'=>array(
			'mapping_type'=>BELONGS_TO,
			'mapping_name'=>'userinfo',
			'class_name'=>'User',
			'foreign_key'=>'founder',
		),

		'SetCookMethod'=>array(
			'mapping_type'=>BELONGS_TO,
			'mapping_name'=>'setcookmethod',
			'class_name'=>'SetCookMethod',
			'foreign_key'=>'cookmethod',
		),

		'SetEasyHard'=>array(
			'mapping_type'=>BELONGS_TO,
			'mapping_name'=>'seteasyhard',
			'class_name'=>'SetEasyHard',
			'foreign_key'=>'easyorhard',
		),

	);

}